import cv2
import numpy as np
from matplotlib import pyplot as plt

img = cv2.imread('131.jpg')
rows,cols,ch = img.shape

pts1 = np.float32([[406,110],[2365,143],[297,3180],[2353,3190]])
pts2 = np.float32([[0,0],[3000,0],[0,3000],[3130,2950]])

M = cv2.getPerspectiveTransform(pts1,pts2)

dst = cv2.warpPerspective(img,M,(3000,3000))

plt.subplot(121),plt.imshow(img),plt.title('Input')
plt.subplot(122),plt.imshow(dst),plt.title('Output')
plt.show()